﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using Controller;
using System.IO;
using System.Net.Mail;

namespace Fejllog
{
    public partial class FrmSePatchNotes : Form
    {
        ClsSystemController systemController;
        const string FILNAVN = "PatchNotes.txt"; // navnet på filen der skal indlæses fra

        public FrmSePatchNotes(ClsSystemController systemController)
        {
            InitializeComponent();
            this.systemController = systemController;
        }

        private void btnTilbage_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void FrmSePatchNotes_Load(object sender, EventArgs e)
        {
            btnTilbage.Focus();

            StreamReader inputStream;
            string linie;

            try
            {
                inputStream = File.OpenText(FILNAVN);
            }

            catch
            {
                MessageBox.Show("Fejl opstod ved indlæsning af patch notes");
                return;
            }

            linie = inputStream.ReadLine(); // indlæs linie
            txtPatchNotes.Text = "Patch notes: ";

            while (linie != null)
            {
                txtPatchNotes.Text +=Environment.NewLine+ linie;
                linie = inputStream.ReadLine();
            }

            inputStream.Close();
        }

        private void btnSendNotes_Click(object sender, EventArgs e)
        {
            // åben hjemmesiden "www.hotmail.com" 
            System.Diagnostics.Process.Start("www.hotmail.com");
        }
    }
}
